/**
 * This file is part of Sonedyan.
 * 
 * Sonedyan is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public
 * License as published by the Free Software Foundation;
 * either version 3 of the License, or (at your option) any
 * later version.
 *
 * Sonedyan is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied
 * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
 * PURPOSE.  See the GNU General Public License for more
 * details.
 *
 * You should have received a copy of the GNU General Public
 * License along with Octave; see the file COPYING.  If not
 * see <http://www.gnu.org/licenses/>.
 * 
 * Copyright (C) 2009-2012 Jimmy Dubuisson <jimmy.dubuisson@gmail.com>
 */

package org.unige.mpej.eckmann.sonedyan.enron.db;

import java.util.Date;
import java.util.Hashtable;
import java.util.List;
import javax.mail.Address;

import org.unige.mpej.eckmann.sonedyan.enron.bean.Actor;
import org.unige.mpej.eckmann.sonedyan.enron.bean.Email;
import org.unige.mpej.eckmann.sonedyan.enron.bean.EnronMessage;
import org.unige.mpej.eckmann.sonedyan.enron.bean.Link;

/**
 * Database handler abstract class
 */
public abstract class DatabaseHandler 
{
	public abstract int storeEmail(Email email);
	public abstract int storeMessage(EnronMessage message);
	public abstract int storeActor(Actor actor);
	public abstract int storeLink(Link link);
	public abstract boolean storeAllLinks();
	
	public abstract Actor getActorById(String id);
	public abstract Actor getActorByAddress(String address);
	
	public abstract EnronMessage getMessageById(String id);
	
	@Deprecated
	public abstract List<EnronMessage> getAllMessages();
	public abstract Hashtable<Integer, Address> getAllEmails();
	
	public abstract List<EnronMessage> getUniqueRecipientMessages();
	public abstract List<EnronMessage> getUniqueRecipientMessagesInDateRange(Date beginDate, Date endDate);
	public abstract List<Link> getLinksInDateRange(Date beginDate, Date endDate);
	
	public abstract List<EnronMessage> getMessagesByFrom(String fromAddress);
	public abstract List<EnronMessage> getMessagesByTo(String toAddress);
	
	public abstract boolean close();
	
}
